package org.iabako.shared.iservice.user;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.iabako.client.tools.IabakoAsyncCallback;
import org.iabako.shared.entity.enumeration.IabakoPackage;
import org.iabako.shared.entity.user.*;

import java.util.List;

/**
 * Created by jose on 08/12/14.
 */
public interface SignUpServiceAsync {

    void saveEnterprise(Enterprise enterprise, AsyncCallback<Enterprise> asyncCallback);

    void saveEnterprise(Enterprise enterprise, List<EnterpriseCustomInfo> customInfoList, AsyncCallback<Enterprise> asyncCallback);

    void saveUser(User user, AsyncCallback<User> asyncCallback);

    void keyCodeVerification(User user, String value, IabakoPackage signUpIabakoPackage, AsyncCallback<User> iabakoAsyncCallback);

    void getUserPayPalTokenPayedOrToVerify(String param, AsyncCallback<UserPayPalToken> iabakoAsyncCallback);

    void getUserPayPalTokenByTxId(String transactionId, AsyncCallback<UserPayPalToken> iabakoAsyncCallback);

    void getCustomInfoList(AsyncCallback<List<EnterpriseCustomInfo>> async);

    public static final class Util {
        private static SignUpServiceAsync instance;

        public static final SignUpServiceAsync getInstance() {
            if (instance == null) {
                instance = GWT.create(SignUpService.class);
            }
            return instance;
        }
    }
}
